<!--{*
/*
 * This file is part of EC-CUBE
 *
 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
 *
 * http://www.lockon.co.jp/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
*}-->
<script type="text/javascript">
<!--

    function fnCustomerPage(pageno) {
        document.form1.search_pageno.value = pageno;
        document.form1.submit();
    }

    function fnCSVDownload(pageno) {
        document.form1['csv_mode'].value = 'csv';
        document.form1.submit();
        document.form1['csv_mode'].value = '';
        return false;
    }

    function fnDelete(customer_id) {
        if (confirm('この顧客情報を削除しても宜しいですか？')) {
            document.form1.mode.value = "delete"
            document.form1['edit_customer_id'].value = customer_id;
            document.form1.submit();
            return false;
        }
    }

    function fnEdit(customer_id) {
        document.form1.action = './edit.php';
        document.form1.mode.value = "edit_search"
        document.form1['edit_customer_id'].value = customer_id;
        document.form1.search_pageno.value = 1;
        document.form1.submit();
        return false;
    }

    function fnSubmit() {
        document.form1.submit();
        return false;
    }
//-->
</script>

<div id="alpha">
<div id="alpha-inner">
<!--▼SUB NAVI-->
<!--{include file=$tpl_subnavi}-->
<!--▲SUB NAVI-->
</div>
</div>



<div id="beta">
<div id="beta-inner">
<form name="form_search" id="form_search" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->">
<input type="hidden" name="mode" value="search">
<div class="title_page">
<h2><!--{$tpl_subtitle}--></h2>
</div>



<!--検索条件設定テーブルここから-->
<div class="menuclass2">
<table summary="検索条件設定">
<tr>
	<th>顧客コード</th>
	<td><!--{if $arrErr.customer_id}--><span class="red12"><!--{$arrErr.customer_id}--></span><br /><!--{/if}-->
		<input type="text" name="customer_id" maxlength="<!--{$smarty.const.INT_LEN}-->" value="<!--{$arrForm.customer_id|escape}-->" size="30" class="box30" <!--{if $arrErr.customer_id}--><!--{sfSetErrorStyle}--><!--{/if}--> />
	</td>
	<th>都道府県</th>
	<td><!--{if $arrErr.pref}--><span class="red12"><!--{$arrErr.pref}--></span><br><!--{/if}-->
	<select name="pref">
	<option value="" selected="selected" <!--{if $arrErr.name}--><!--{sfSetErrorStyle}--><!--{/if}-->>都道府県を選択</option>
	<!--{html_options options=$arrPref selected=$arrForm.pref}-->
	</select>
	</td>
</tr>
<tr>
	<th>顧客名</th>
	<td><!--{if $arrErr.name}--><span class="red12"><!--{$arrErr.name}--></span><br /><!--{/if}-->
	<input type="text" name="name" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$arrForm.name|escape}-->" size="30" class="box30" <!--{if $arrErr.name}--><!--{sfSetErrorStyle}--><!--{/if}--> />
	</td>
	<th>顧客名（カナ）</th>
	<td><!--{if $arrErr.kana}--><span class="red12"><!--{$arrErr.kana}--></span><br /><!--{/if}-->
	<input type="text" name="kana" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$arrForm.kana|escape}-->" size="30" class="box30" <!--{if $arrErr.kana}--><!--{sfSetErrorStyle}--><!--{/if}--> />
	</td>
</tr>
<tr>
	<th>性別</th>
	<td><!--{html_checkboxes name="sex" options=$arrSex separator="&nbsp;" selected=$arrForm.sex}--></td>
	<th>誕生月</th>
	<td><!--{if $arrErr.birth_month}--><span class="red12"><!--{$arrErr.birth_month}--></span><br><!--{/if}-->
	    <select name="birth_month" style="<!--{$arrErr.birth_month|sfGetErrorColor}-->" >
		<option value="" selected="selected">--</option><!--{html_options options=$objDate->getMonth() selected=$arrForm.birth_month}-->
		</select>月
	</td>
</tr>
<tr>
	<th>誕生日</th>
	<td colspan="3">
	<!--{if $arrErr.b_start_year || $arrErr.b_end_year}--><span class="red12"><!--{$arrErr.b_start_year}--><!--{$arrErr.b_end_year}--></span><br><!--{/if}-->
                                    <select name="b_start_year" <!--{if $arrErr.b_start_year || $arrErr.b_end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">------</option>
                                        <!--{html_options options=$arrYear selected=$arrForm.b_start_year}-->
                                    </select>年
                                    <select name="b_start_month" <!--{if $arrErr.b_start_year || $arrErr.b_end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">----</option>
                                        <!--{html_options options=$arrMonth selected=$arrForm.b_start_month}-->
                                    </select>月
                                    <select name="b_start_day" <!--{if $arrErr.b_start_year || $arrErr.b_end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">----</option>
                                        <!--{html_options options=$arrDay selected=$arrForm.b_start_day}-->
                                    </select>日〜
                                    <select name="b_end_year" <!--{if $arrErr.b_start_year || $arrErr.b_end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">------</option>
                                        <!--{html_options options=$arrYear selected=$arrForm.b_end_year}-->
                                    </select>年
                                    <select name="b_end_month" <!--{if $arrErr.b_start_year || $arrErr.b_end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">----</option>
                                        <!--{html_options options=$arrMonth selected=$arrForm.b_end_month}-->
                                    </select>月
                                    <select name="b_end_day" <!--{if $arrErr.b_start_year || $arrErr.b_end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">----</option>
                                        <!--{html_options options=$arrDay selected=$arrForm.b_end_day}-->
                                    </select>日
	</td>
</tr>
<tr>
	<th>メールアドレス</th>
	<td colspan="3"><!--{if $arrErr.email}--><span class="red12"><!--{$arrErr.email}--></span><!--{/if}-->
	<input type="text" name="email" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$arrForm.email|escape}-->" size="60" class="box60" <!--{if $arrErr.email}--><!--{sfSetErrorStyle}--><!--{/if}-->/>
	</td>
</tr>
<tr>
	<th nowrap="nowrap">携帯メールアドレス</th>
	<td colspan="3"><!--{if $arrErr.email_mobile}--><span class="red12"><!--{$arrErr.email_mobile}--></span><!--{/if}-->
	<input type="text" name="email_mobile" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$arrForm.email_mobile|escape}-->" size="60" class="box60" <!--{if $arrErr.email_mobile}--><!--{sfSetErrorStyle}--><!--{/if}-->/>
	</td>
</tr>
<tr>
	<th>電話番号</th>
	<td colspan="3"><!--{if $arrErr.tel}--><span class="red12"><!--{$arrErr.tel}--></span><br /><!--{/if}-->
	<input type="text" name="tel" maxlength="<!--{$smarty.const.TEL_LEN}-->" value="<!--{$arrForm.tel|escape}-->" size="60" class="box60" />
	</td>
</tr>
<tr>
	<th>職業</th>
	<td colspan="3"><!--{html_checkboxes name="job" options=$arrJob separator="&nbsp;" selected=$arrForm.job}--></td>
</tr>
<tr>
	<th>購入金額</th>
	<td><!--{if $arrErr.buy_total_from || $arrErr.buy_total_to}--><span class="red12"><!--{$arrErr.buy_total_from}--><!--{$arrErr.buy_total_to}--></span><br /><!--{/if}-->
	<input type="text" name="buy_total_from" maxlength="<!--{$smarty.const.INT_LEN}-->" value="<!--{$arrForm.buy_total_from|escape}-->" size="6" class="box6" <!--{if $arrErr.buy_total_from || $arrErr.buy_total_to}--><!--{sfSetErrorStyle}--><!--{/if}--> /> 円 〜 <input type="text" name="buy_total_to" maxlength="<!--{$smarty.const.INT_LEN}-->" value="<!--{$arrForm.buy_total_to|escape}-->" size="6" class="box6" <!--{if $arrErr.buy_total_from || $arrErr.buy_total_to}--><!--{sfSetErrorStyle}--><!--{/if}--> /> 円
	</td>
	<th>購入回数</th>
	<td><!--{if $arrErr.buy_times_from || $arrErr.buy_times_to}--><span class="red12"><!--{$arrErr.buy_times_from}--><!--{$arrErr.buy_times_to}--></span><br><!--{/if}--><input type="text" name="buy_times_from" maxlength="<!--{$smarty.const.INT_LEN}-->" value="<!--{$arrForm.buy_times_from|escape}-->" size="6" class="box6" <!--{if $arrErr.buy_times_from || $arrErr.buy_times_to}--><!--{sfSetErrorStyle}--><!--{/if}--> /> 回 〜 <input type="text" name="buy_times_to" maxlength="<!--{$smarty.const.INT_LEN}-->" value="<!--{$arrForm.buy_times_to|escape}-->" size="6" class="box6" <!--{if $arrErr.buy_times_from || $arrErr.buy_times_to}--><!--{sfSetErrorStyle}--><!--{/if}--> /> 回
	</td>
</tr>
<tr>
	<th>登録・更新日</th>
	<td colspan="3">
	<!--{if $arrErr.start_year || $arrErr.end_year}--><span class="red12"><!--{$arrErr.start_year}--><!--{$arrErr.end_year}--></span><br /><!--{/if}-->
                                    <select name="start_year" <!--{if $arrErr.start_year || $arrErr.end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">----</option>
                                        <!--{html_options options=$arrYear selected=$arrForm.start_year}-->
                                    </select>年
                                    <select name="start_month" <!--{if $arrErr.start_year || $arrErr.end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">--</option>
                                        <!--{html_options options=$arrMonth selected=$arrForm.start_month}-->
                                    </select>月
                                    <select name="start_day" <!--{if $arrErr.start_year || $arrErr.end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">--</option>
                                        <!--{html_options options=$arrDay selected=$arrForm.start_day}-->
                                    </select>日〜
                                    <select name="end_year" <!--{if $arrErr.start_year || $arrErr.end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">----</option>
                                        <!--{html_options options=$arrYear selected=$arrForm.end_year}-->
                                    </select>年
                                    <select name="end_month" <!--{if $arrErr.start_year || $arrErr.end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">--</option>
                                        <!--{html_options options=$arrMonth selected=$arrForm.end_month}-->
                                    </select>月
                                    <select name="end_day" <!--{if $arrErr.start_year || $arrErr.end_year}--><!--{sfSetErrorStyle}--><!--{/if}-->>
                                        <option value="" selected="selected">--</option>
                                        <!--{html_options options=$arrDay selected=$arrForm.end_day}-->
                                    </select>日
	</td>
</tr>
<tr>
	<th>最終購入日</th>
	<td colspan="3">
	<!--{if $arrErr.buy_start_year || $arrErr.buy_end_year}--><span class="red12"><!--{$arrErr.buy_start_year}--><!--{$arrErr.buy_end_year}--></span><br /><!--{/if}-->
                                    <select name="buy_start_year" style="<!--{$arrErr.buy_start_year|sfGetErrorColor}-->">
                                        <option value="" selected="selected">----</option>
                                        <!--{html_options options=$objDate->getYear($smarty.const.RELEASE_YEAR)  selected=$arrForm.buy_start_year}-->
                                    </select>年
                                    <select name="buy_start_month" style="<!--{$arrErr.buy_start_year|sfGetErrorColor}-->">
                                        <option value="" selected="selected">--</option>
                                        <!--{html_options options=$arrMonth selected=$arrForm.buy_start_month}-->
                                    </select>月
                                    <select name="buy_start_day" style="<!--{$arrErr.buy_start_year|sfGetErrorColor}-->">
                                        <option value="" selected="selected">--</option>
                                        <!--{html_options options=$arrDay selected=$arrForm.buy_start_day}-->
                                    </select>日〜
                                    <select name="buy_end_year" style="<!--{$arrErr.buy_end_year|sfGetErrorColor}-->">
                                        <option value="" selected="selected">----</option>
                                        <!--{html_options options=$objDate->getYear($smarty.const.RELEASE_YEAR)  selected=$arrForm.buy_end_year}-->
                                    </select>年
                                    <select name="buy_end_month" style="<!--{$arrErr.buy_end_year|sfGetErrorColor}-->">
                                        <option value="" selected="selected">--</option>
                                        <!--{html_options options=$arrMonth selected=$arrForm.buy_end_month}-->
                                    </select>月
                                    <select name="buy_end_day" style="<!--{$arrErr.buy_end_year|sfGetErrorColor}-->">
                                        <option value="" selected="selected">--</option>
                                        <!--{html_options options=$arrDay selected=$arrForm.buy_end_day}-->
                                    </select>日
	</td>
</tr>
<tr>
	<th>購入商品名</th>
	<td>
	<!--{if $arrErr.buy_product_name}--><span class="red12"><!--{$arrErr.buy_product_name}--></span><!--{/if}-->
	<span style="<!--{$arrErr.buy_product_name|sfGetErrorColor}-->">
	<input type="text" name="buy_product_name" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$arrForm.buy_product_name|escape}-->" size="30" class="box30" style="<!--{$arrErr.buy_product_name|sfGetErrorColor}-->"/>
	</span>
	</td>
	<th nowrap="nowrap">購入商品コード</th>
	<td>
	<!--{if $arrErr.buy_product_code}--><span class="red12"><!--{$arrErr.buy_product_code}--></span><!--{/if}-->
	<input type="text" name="buy_product_code" value="<!--{$arrForm.buy_product_code}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->" size="30" class="box30" style="<!--{$arrErr.buy_product_code|sfGetErrorColor}-->" >
	</td>
</tr>
<tr>
	<th>カテゴリ</th>
	<td colspan="3">
	<select name="category_id" style="<!--{if $arrErr.category_id != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}--><!--{/if}-->">
	<option value="">選択してください</option><!--{html_options options=$arrCatList selected=$arrForm.category_id}-->
	</select>
	</td>
</tr>
</table>
</div>
<!--検索条件設定テーブルここまで-->



<h3>検索結果表示件数：<select name="page_rows"><!--{html_options options=$arrPageRows selected=$arrForm.page_rows}--></select> 件</h3>



<div class="btn_box">
<input type="submit" name="subm" value="この条件で検索する" />
</div>



</form>



<!--{if count($arrErr) == 0 and ($smarty.post.mode == 'search' or $smarty.post.mode == 'delete') }-->
<!--★★検索結果一覧★★-->
<form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->">
<!--{foreach from=$smarty.post key="key" item="item"}-->
<!--{if $key ne "mode" && $key ne "del_mode" && $key ne "edit_customer_id" && $key ne "del_customer_id" && $key ne "search_pageno" && $key ne "csv_mode" && $key ne "job" && $key ne "sex"}--><input type="hidden" name="<!--{$key|escape}-->" value="<!--{$item|escape}-->"><!--{/if}-->
<!--{/foreach}-->
<!--{foreach from=$smarty.post.job key="key" item="item"}-->
<input type="hidden" name="job[]" value=<!--{$item}-->>
<!--{/foreach}-->
<!--{foreach from=$smarty.post.sex key="key" item="item"}-->
<input type="hidden" name="sex[]" value=<!--{$item}-->>
<!--{/foreach}-->
<input type="hidden" name="mode" value="search">
<input type="hidden" name="del_mode" value="">
<input type="hidden" name="edit_customer_id" value="">
<input type="hidden" name="del_customer_id" value="">
<input type="hidden" name="search_pageno" value="<!--{$smarty.post.search_pageno|escape}-->">
<input type="hidden" name="csv_mode" value="">

	<!--検索結果数-->
	<h3>検索結果一覧　<span class="reselt"><!--{$tpl_linemax}-->件</span>&nbsp;が該当しました。</h3>

	<div class="searchit">
	<ul>
	<!--{if $smarty.const.ADMIN_MODE == '1'}-->
	<li><input type="button" name="subm" value="検索結果をすべて削除" onclick="fnModeSubmit('delete_all','','');" /></li>
	<!--{/if}-->
	<li>
	<a href="#" onclick="fnModeSubmit('csv','','');" >CSV DOWNLOAD</a>｜<a href="../contents/csv.php?tpl_subno_csv=customer"> >> CSV出力項目設定</a>
	</li>
	</ul>
	</div>
	<!--{include file=$tpl_pager}-->



<!--{if count($search_data) > 0}-->
<!--検索結果表示テーブル-->
<div class="menuclass">
<table summary="検索結果一覧">
<tr>
	<th rowspan="2">種別</th><th>顧客コード</th><th rowspan="2">顧客名/（カナ）</th>
	<th rowspan="2">性別</th><th>TEL</th><th rowspan="2">編集</th><th rowspan="2">削除</th>
</tr>
<tr>
	<th>都道府県</th><th>メールアドレス</th>
</tr>
	<!--{section name=data loop=$search_data}-->
	<!--顧客<!--{$smarty.section.data.iteration}-->-->
	<tr>
		<td align="center" rowspan="2"><!--{if $search_data[data].status eq 1}-->仮<!--{else}-->本<!--{/if}--></td>
		<td><!--{$search_data[data].customer_id|escape}--></td>
		<td rowspan="2"><!--{$search_data[data].name01|escape}--> <!--{$search_data[data].name02|escape}-->(<!--{$search_data[data].kana01|escape}--> <!--{$search_data[data].kana02|escape}-->)</td>
		<td align="center" rowspan="2"><!--{if $search_data[data].sex eq 1}-->男性<!--{else}-->女性<!--{/if}--></td>
		<td><!--{$search_data[data].tel01|escape}-->-<!--{$search_data[data].tel02|escape}-->-<!--{$search_data[data].tel03|escape}--></td>
		<td align="center" rowspan="2">
		<span class="icon_edit"><a href="#" onclick="return fnEdit('<!--{$search_data[data].customer_id|escape}-->');">編集</a></span>
		</td>
		<td align="center" rowspan="2">
		<span class="icon_delete"><a href="#" onclick="return fnDelete('<!--{$search_data[data].customer_id|escape}-->');">削除</a></span>
		</td>
	</tr>
	<tr>
		<td><!--{assign var=pref value=$search_data[data].pref}--><!--{$arrPref[$pref]}--></td>
		<td><!--{mailto address=$search_data[data].email encode="javascript"}--></a></td>
	</tr>
	<!--顧客<!--{$smarty.section.data.iteration}-->-->
	<!--{/section}-->
</table>
<!--検索結果表示テーブル-->
</div>
<!--{/if}-->


</form>
<!--{/if}-->
</div>
</div>
